template(name="newHeader")
  //-
    If the user is connected we display a small "quick-access" top bar that
    list all starred boards with a link to go there. This is inspired by the
    Reddit "subreddit" bar.
    The first link goes to the boards page.
  if currentUser
      #header-quick-access2(class=currentBoard.colorClass)
        #header1
          if isMiniScreen
            span
              a(href="{{pathFor 'newHome'}}")
                span.fa.fa-home

            ul.header-quick-access-list
              if currentList
                each currentBoard.lists
                  li(class="{{#if $.Session.equals 'currentList' _id}}current{{/if}}")
                    a.js-select-list
                      = title
              else
                each currentUser.starredBoards
                  li(class="{{#if $.Session.equals 'currentBoard' _id}}current{{/if}}")
                    a(href="{{pathFor 'board' id=_id slug=slug}}")
                      = title
            #header-new-board-icon
          else
            //-
              On sandstorm, the logo shouldn't be clickable, because we only have one
              page/document on it, and we don't want to see the home page containing
              the list of all boards.
            unless currentSetting.hideLogo
              if currentSetting.customTopLeftCornerLogoImageUrl
                if currentSetting.customTopLeftCornerLogoLinkUrl
                  a(href="{{currentSetting.customTopLeftCornerLogoLinkUrl}}")
                    img(src="{{currentSetting.customTopLeftCornerLogoImageUrl}}" height="{{#if currentSetting.customTopLeftCornerLogoHeight}}#{currentSetting.customTopLeftCornerLogoHeight}{{else}}27{{/if}}" width="auto" margin="0" padding="0")
                unless currentSetting.customTopLeftCornerLogoLinkUrl
                  img(src="{{currentSetting.customTopLeftCornerLogoImageUrl}}" height="{{#if currentSetting.customTopLeftCornerLogoHeight}}#{currentSetting.customTopLeftCornerLogoHeight}{{else}}27{{/if}}" width="auto" margin="0" padding="0")
              unless currentSetting.customTopLeftCornerLogoImageUrl
                img(src="{{pathFor '/kanban-logo2.svg'}}" height="{{#if currentSetting.customTopLeftCornerLogoHeight}}#{currentSetting.customTopLeftCornerLogoHeight}{{else}}33{{/if}}" width="auto" margin="0" padding="0")
                //-img(src="{{pathFor '/logo.svg'}}" alt="")
            span.allBoards
              a(href="{{pathFor 'newHome'}}")
                span.fa.fa-home
                | {{_ 'all-boards'}}
            ul.header-quick-access-list
              //li
              //  a(href="{{pathFor 'public'}}")
              //    span.fa.fa-globe
              //    | {{_ 'public'}}
              each currentUser.starredBoards
                li(class="{{#if $.Session.equals 'currentBoard' _id}}current{{/if}}")
                  a(href="{{pathFor 'board' id=_id slug=slug}}")
                    = title
              else
                li.current.empty {{_ 'quick-access-description'}}

          // Next line is used only for spacing at header,
          // there is no visible clickable icon.
          #header-new-board-icon
          //  Hide duplicate create board button,
          //  because it did not show board templates correctly.
          //a#header-new-board-icon.js-create-board
          //  i.fa.fa-plus(title="Create a new board")

          +notifications

          +headerUserBar

    //- if isMainPage
    //-   #header2(class=currentBoard.colorClass)
    //-     //-
    //-       The main bar is a colorful bar that provide all the meta-data for the
    //-       current page. This bar is contextual based.
    //-       If the user is not connected we display "sign in" and "log in" buttons.
    //-     #header-main-bar(class="{{#if wrappedHeader}}wrapper{{/if}}")
    //-       +Template.dynamic(template=headerBar)

  if appIsOffline
    +newOfflineWarning

  if currentUser.isBoardMember
    if hasAnnouncement
      .announcement
        p
          i.fa.fa-bullhorn
          +viewer
            | #{announcement}
          i.fa.fa-times-circle.js-close-announcement

template(name="newOfflineWarning")
  .offline-warning
    p
      i.fa.fa-warning
      | {{_ 'app-is-offline'}}
